The process of using Callable IDL has three stages: initialization, IDL use, and cleanup.
Between the initialization and the cleanup, your program contains a complete active IDL session just as if a user were typing commands at an IDL> prompt. In addition to the usual IDL abilities, you can import data from your program and cause IDL to see it as an IDL variable. IDL can use such data in computations as if it had created the variable itself. In addition, you can obtain pointers to data currently held by IDL variables and access the results of IDL computations from your program.
Note: The functions documented in this chapter should only be used when calling IDL from other programs—their use in code called by IDL via CALL_EXTERNAL or a system routine (LINKIMAGE, Dynamically Loadable Module) is not supported and is certain to corrupt and/or crash the IDL process.
Before calling IDL to execute instructions, you must initialize it. This is done by calling IDL_Initialize(). This is a one-time operation, and must occur before calling any other IDL function. Once IDL is initialized, you can:
The above list is not complete, but is representative of the possibilities afforded by Callable IDL.
After all IDL use is complete, but before the program exits, you must call IDL_Cleanup() to allow IDL to shutdown gracefully and clean up after itself. Once this has been done, you are not allowed to call IDL again from this process. See Cleanup for more information.